<template>
	<view class="service-point">
		<NavBar title="服务点" :isBack="true"></NavBar>
		<view class="content">
			<view class="search">
				<image src="@/static/icons/search.png"></image>
				<input type="text" placeholder="输入服务点名称 搜索" placeholder-class="placeholder">
			</view>
			<view class="main">
				<view class="footer-area" v-for="item in list">
					<view class="shop-info-item">
						<image class="shop-img" src="@/static/services/demo.png"></image>
						<view class="info">
							<view class="name">{{ item.company }}</view>
							<view>{{ item.address }}</view>
							<view>管理员：{{ item.name }}</view>
							<view>联系电话：{{ item.mobile }}</view>
						</view>
					</view>
					<view class="btn-area">
						<view>修改信息</view>
						<view @click="$gotoUrl('/pages/services/orderManagement')">查看订单</view>
						<view>删除服务点</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
import { reactive, toRefs } from 'vue'
import { getServicePointList } from '@/api/services'
const state = reactive({
	list: [],
	form: {
		page: 1,
		limit: 10
	}
})
function getList () {
	getServicePointList(state.form).then(res => {
		state.list = res.data.data
	})
}
getList()
const { list } = toRefs(state)
</script>

<style lang="scss" scoped>
.service-point {
	.content {
		position: relative;
		z-index: 1;
		padding: 24rpx 36rpx;
		background: #fff;
		border-radius: 22rpx 22rpx 0rpx 0rpx;

		.search {
			width: 678rpx;
			height: 88rpx;
			background: #F5F5F5;
			border-radius: 22rpx 22rpx 22rpx 22rpx;
			padding: 38rpx 22rpx;
			box-sizing: border-box;
			font-size: 30rpx;
			display: flex;
			align-items: center;
			margin-bottom: 28rpx;

			image {
				width: 44rpx;
				height: 44rpx;
				margin-right: 22rpx;
			}

			.placeholder {
				font-weight: 500;
				color: #999999;
			}
		}

		.main {
			margin-top: 43rpx;

			.footer-area {
				margin-top: 36rpx;

				.btn-area {
					padding-bottom: 40rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;
					border-bottom: 1rpx solid #F5F5F5;

					view {
						font-weight: 800;
						font-size: 30rpx;
						color: #58DBCF;
						border-radius: 500rpx 500rpx 500rpx 500rpx;
						border: 1rpx solid #58DBCF;
						padding: 12rpx 36rpx;
						box-sizing: border-box;
					}
				}

				.shop-info-item {
					display: flex;
					margin-bottom: 36rpx;

					.shop-img {
						width: 155rpx;
						height: 155rpx;
						border-radius: 16rpx 16rpx;
						margin-right: 24rpx;
					}

					.info {
						font-weight: 500;
						font-size: 20rpx;
						color: #999999;

						.name {
							font-weight: bold;
							font-size: 28rpx;
							color: #333333;
						}

						view {
							margin-bottom: 8rpx;
						}
					}
				}
			}
		}
	}
}
</style>